#include <algorithm>
#include <string>
class Solution {
public:
    string solve(string s, string t) {
        int i = s.size() - 1, j = t.size() - 1;
        int sum = 0;
        string ret;
        while (i >= 0 || j >= 0 || sum)
        {
            if (i >= 0)
                sum += (s[i--] - '0');
            if (j >= 0)
                sum += (t[j--] - '0');
            ret += (sum % 10 + '0');
            sum /= 10;
        }

        reverse(ret.begin(), ret.end());
        return ret;
    }
};
